<template>
	<view class="container bg-white">
		<view class="padding bg-white">
			<view class="text-center text-size-32 text-bold">{{ agreementInfo.name }}</view>
			<view class="padding-sm">
				<rich-text :nodes="agreementInfo.content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		onShow
	} from '@dcloudio/uni-app';
	import {
		useSettingStore
	} from '@/stores/index';
	import {
		agreement
	} from '@/common/api/user';
	import {
		ref
	} from 'vue';
	const setting = useSettingStore();
	const agreementInfo = ref({
		content: '',
		createTime: '2022-12-06 20:58:53',
		enabled: true,
		id: 3,
		name: '用户协议',
		type: 'userServiceAgreement',
		url: ''
	});
	const onLoadAgreement = async () => {
		const res: any = await agreement('userServiceAgreement');
		if (res.code == 1000) {
			agreementInfo.value = res.data;
		}
	};
	onShow(() => {
		onLoadAgreement();
	});
</script>

<style></style>
